package com.qianli.user.exception;

import com.fqgj.exception.enums.MsgCodeEnum;
import com.qianli.user.ro.UserStateCode;

/**
 * @author zsp
 */
public class UserException extends RuntimeException {

    private static final long serialVersionUID = -453470388637632744L;
    private MsgCodeEnum errorEnum;

    /**
     * 默认内部错误
     */
    public UserException() {
        this.errorEnum = UserStateCode.INTERNAL_SERVER_ERROR;
    }

    public UserException(MsgCodeEnum errorEnum) {
        super(errorEnum.getMsg());
        this.errorEnum = errorEnum;
    }

    public MsgCodeEnum getErrorEnum() {
        return errorEnum;
    }
}
